package com.dyc.caradvertisting.ui.fmt.tab.store.gd;

import android.util.Log;

import com.dyc.caradvertisting.bean.req.RequestBean;
import com.dyc.caradvertisting.bean.resp.ClientBean;
import com.dyc.caradvertisting.bean.resp.GoodsD;
import com.dyc.caradvertisting.constants.Constant;

import java.util.List;
import java.util.Map;

import rx.Observable;
import rx.Observer;


/**
 * Created by niejiahuan on 2016/5/31.
 */
public class GoodsDPresenter extends GoodsDContract.Presenter {


    @Override
    public Observable getDate(Map<String, String> params) {
        return null;
    }

    @Override
    public void onStart() {

    }

    @Override
    public void reqGoodsDetails(String param) {
        RequestBean requestBean=new RequestBean(Constant.REQ_GOODS_DETAILS,param);
        mModel.reqGoodsDetails(requestBean.getAct()+"",
                requestBean.getAct()+"",
                requestBean.getParam(),
                requestBean.getSign(),
                requestBean.getStrtime()+"")
                .subscribe(new Observer<GoodsD>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {
             mView.showError(e);
            }

            @Override
            public void onNext(GoodsD o) {
                mView.initData(o);
            }
        });
    }
}
